﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" xmlns:toolkitPrimitives="clr-namespace:Microsoft.Phone.Controls.Primitives;assembly=Microsoft.Phone.Controls.Toolkit" mc:Ignorable="d">
	<!-- Resource dictionary entries should be defined here. -->
	<DataTemplate x:Key="ChatMessageDataTemplate">
		<StackPanel>
			<TextBlock TextWrapping="Wrap" Text="{Binding From, StringFormat=\{0\}:}" TextDecorations="Underline" FontFamily="{StaticResource PhoneFontFamilySemiBold}" FontWeight="Bold" FontSize="{StaticResource PhoneFontSizeLarge}" HorizontalAlignment="Left" Margin="8,0,0,0" Foreground="{StaticResource SubtitleBrush}"/>
			<TextBlock Text="{Binding Content}" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeMediumLarge}" HorizontalAlignment="Left" TextWrapping="Wrap" Margin="3,0,0,0" Foreground="{StaticResource LightBrush}"/>
		</StackPanel>
	</DataTemplate>
	<ControlTemplate x:Key="EmptyButtonTemplate" TargetType="Button">
		<ContentPresenter/>
	</ControlTemplate>
	<DataTemplate x:Key="BotDataTemplate">
		<Button Content="{Binding Name}" Template="{StaticResource EmptyButtonTemplate}" FontSize="{StaticResource PhoneFontSizeExtraLarge}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Command="{Binding ChatWithBotCommand}" CommandParameter="{Binding Mode=OneWay}" Foreground="{StaticResource NeutralBrush}" FontWeight="Bold" Margin="0,2">
            <toolkit:ContextMenuService.ContextMenu>
                <toolkit:ContextMenu>
                    <toolkit:MenuItem Header="{Binding AppResources.Add, Source={StaticResource Localizator}}" Command="{Binding Library.AddCommand, Source={StaticResource Locator}}" CommandParameter="{Binding}" />
                </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
        </Button>
	</DataTemplate>
	<Style x:Key="StandardToggleSwitchTemplate" TargetType="toolkit:ToggleSwitch">
		<Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
		<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyLight}"/>
		<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeLarge}"/>
		<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
		<Setter Property="IsTabStop" Value="False"/>
		<Setter Property="HorizontalContentAlignment" Value="Left"/>
		<Setter Property="SwitchForeground" Value="{StaticResource PhoneAccentBrush}"/>
		<Setter Property="VerticalContentAlignment" Value="Top"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="toolkit:ToggleSwitch">
					<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CacheMode="BitmapCache" Padding="{TemplateBinding Padding}">
						<VisualStateManager.VisualStateGroups>
							<VisualStateGroup x:Name="CommonStates">
								<VisualState x:Name="Normal"/>
								<VisualState x:Name="Disabled">
									<Storyboard>
										<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Header"/>
										<DoubleAnimation Duration="0" To="0.3" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content"/>
									</Storyboard>
								</VisualState>
							</VisualStateGroup>
						</VisualStateManager.VisualStateGroups>
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="*"/>
								<ColumnDefinition Width="Auto"/>
							</Grid.ColumnDefinitions>
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="Auto"/>
							</Grid.RowDefinitions>
							<ContentControl x:Name="Header" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" Foreground="{StaticResource PhoneSubtleBrush}" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalAlignment="Left" IsTabStop="False" Margin="-1,0,0,0" Opacity="{TemplateBinding Opacity}" VerticalAlignment="Bottom"/>
							<ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="-1,1,0,-7" Opacity="{TemplateBinding Opacity}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							<toolkitPrimitives:ToggleSwitchButton x:Name="Switch" Background="{TemplateBinding Background}" Grid.Column="1" Margin="-22,-29,-24,-28" Opacity="{TemplateBinding Opacity}" Grid.RowSpan="2" SwitchForeground="{TemplateBinding SwitchForeground}" VerticalAlignment="Bottom"/>
						</Grid>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>